projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ed3f04
)
(seq-contains-p): Refine the non-nil returned value
author
Stefan Monnier
<monnier@iro.umontreal.ca>
Thu, 17 Mar 2022 13:54:41 +0000
(09:54 -0400)
committer
Stefan Monnier
<monnier@iro.umontreal.ca>
Thu, 17 Mar 2022 13:54:41 +0000
(09:54 -0400)
* lisp/emacs-lisp/seq.el (seq-contains-p): Like `cl-some` return the
value returned by the test function rather than t.
lisp/emacs-lisp/seq.el
patch
|
blob
|
history
diff --git
a/lisp/emacs-lisp/seq.el
b/lisp/emacs-lisp/seq.el
index 5ea9fae2e9b5f122b579887237dff3e3751b313a..1bcb844d8e9abef714d0a46e1a918f953639d42c 100644
(file)
--- a/
lisp/emacs-lisp/seq.el
+++ b/
lisp/emacs-lisp/seq.el
@@
-418,8
+418,9
@@
Equality is defined by TESTFN if non-nil or by `equal' if nil."
Equality is defined by TESTFN if non-nil or by `equal' if nil."
(catch 'seq--break
(seq-doseq (e sequence)
- (when (funcall (or testfn #'equal) e elt)
- (throw 'seq--break t)))
+ (let ((r (funcall (or testfn #'equal) e elt)))
+ (when r
+ (throw 'seq--break r))))
nil))
(cl-defgeneric seq-set-equal-p (sequence1 sequence2 &optional testfn)